<template>
	<view class="page">
    <u-navbar :fixed="false" title="查询仓位" :autoBack="true" bgColor="transparent"></u-navbar>
    <view class="content">
      <view class="list-title-text u-m-b-20"><view class="text">商品属性</view><view class="line" /></view>
      <view class="table-box">
        <uni-table align="left" border :stripe="false" emptyText="暂无更多数据" >
          <!-- 表头行 -->
          <uni-tr>
            <uni-th v-for="(item, index) in columns" :key="index">{{ item.title }}</uni-th>
          </uni-tr>
          <!-- 表格数据行 -->
          <uni-tr v-for="item in tableList" :key="item.id">
            <template v-if="zitem.slot">
              <template v-if="zitem.key=='actions'"><text class="u-color-primary">查看</text></template>
            </template>
            <uni-td v-for="(zitem, zindex) in columns" :key="zindex">{{ item[zitem.key] }}</uni-td>
          </uni-tr>
        </uni-table>
      </view>
    </view>
	</view>
</template>

<script>
import { getPositionInfo } from '@/api/index'

export default {
  data() {
    return {
      columns: [
        // {
        //   title: '物料编码',
        //   key: 'MterialFnumber',
        // },
        {
          title: '物料名称',
          key: 'MterialName',
        },
        {
          title: '仓库名称',
          key: 'StockName',
        },
        {
          title: '仓位名称',
          key: 'StockLocName',
        },
        {
          title: '货位数量',
          key: 'ExistQty',
        },
      ],
      tableList: [],
    }
  },
  onLoad(options) {
    getPositionInfo({ "parameters": [ options ] }).then(res => {
      if(res.IsSuccess !== 'false') {
        this.tableList = res.StockLocList
      }
    })
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
.page{
	width: 750rpx;
	min-height: 100vh;
  padding-bottom: 188rpx;
  .content {
    width: 100%;
    padding: 0 30rpx;
  }
  .search {
    margin-top: 20rpx;
    padding: 16rpx 20rpx;
    background: #FFF;
    border-radius: 20rpx;
    box-shadow: 3rpx 3rpx 4rpx rgba(0, 0, 0, 0.16);
  }
  .table-box {
    box-shadow: 3rpx 3rpx 4rpx rgba(0, 0, 0, 0.16);
  }
}
</style>
